//
//  myCollectionViewCell.m
//  ui豆瓣
//
//  Created by lirui on 15/12/28.
//  Copyright © 2015年 www.lanou3g.com蓝鸥科技. All rights reserved.
//

#import "myCollectionViewCell.h"

@implementation myCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.imgview =[[  UIImageView alloc] init];
        _imgview.backgroundColor =[  UIColor yellowColor];
        
        [self.contentView addSubview:_imgview];
        
        self.name =[[ UILabel alloc] init];
        //_name.backgroundColor = [ UIColor greenColor];
        [self.contentView addSubview:_name];
        _name.font = [UIFont systemFontOfSize:15];
        _name.textAlignment = NSTextAlignmentCenter;
        
       self.star1 =[[ UIImageView alloc] init];
       // _star1.backgroundColor =[ UIColor redColor];
        [self.contentView addSubview:_star1];
        
                self.star2 =[[UIImageView alloc] init];
       //_star2.backgroundColor =[ UIColor greenColor];
        [self.contentView addSubview:_star2];
       
        self.star3 =[[UIImageView alloc] init];
      // _star3.backgroundColor =[ UIColor yellowColor];
       [self.contentView addSubview:_star3];
                self.star4 =[[UIImageView alloc] init];
       // _star4.backgroundColor =[ UIColor redColor];
        [self.contentView addSubview:_star4];

        self.star5 =[[UIImageView alloc] init];
       // _star5.backgroundColor =[ UIColor yellowColor];
        [self.contentView addSubview:_star5];
        self.fen =[[ UILabel alloc] init];
      //  _fen.backgroundColor =[ UIColor cyanColor];
        [self.contentView addSubview:_fen];
        self.fen.font = [ UIFont systemFontOfSize:13];
//        self.star = [ [ UIImageView alloc] init];
//        self.backgroundColor = [ UIColor yellowColor];
//        [self. contentView addSubview:_star];
    }
    return self;
}
//布局方法
- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{
    _imgview.frame = CGRectMake(0, 0, layoutAttributes.size.width, layoutAttributes.size.height- 60 );
    _name.frame = CGRectMake(0, layoutAttributes.size.height - 60, layoutAttributes.size.width, 25);
    _star1.frame = CGRectMake(0, layoutAttributes.size.height -35, 15, 15);
    _star2.frame = CGRectMake(15, layoutAttributes.size.height -35, 15 , 15);
     _star3.frame = CGRectMake(30, layoutAttributes.size.height -35, 15 , 15);
 _star4.frame = CGRectMake(45, layoutAttributes.size.height -35, 15 , 15);
     _star5.frame = CGRectMake(60, layoutAttributes.size.height -35, 15 , 15);
    _fen.frame = CGRectMake(90, layoutAttributes.size.height -35, 25, 15);
    //_star.frame = CGRectMake(0, layoutAttributes.size.height - 35, 88, 15);
}

@end
